{include file="admin@public/header" /}

<style>
    #matchCon { width: 100px; }
    .grid-wrap{position:relative;}
    .ztreeDefault{position: absolute;right: 0;top: 0;background-color: #fff;border: 1px solid #D6D5D5;width: 140px;height: 406px;overflow-y: auto;}
    a.snforinventory,a.snforinventory:hover{position:absolute;top:0;right:20px;text-decoration:none;}
    .text-sn{float:left;margin-left:15px;}
    .text-sn .title{background: #EEEEEE url(/css/img/ui-th.png) 0 0 repeat-x;border:1px solid #dedede;color:#555;height: 28px;border-bottom: none;line-height: 28px;  font-weight: bold;padding-left: 20px;font-size: 14px;}
    textarea.ui-input{width:250px;height:340px;line-height:2.7;}
</style>

<div class="container fix p20">
    <div class="mod-search m0 cf">
      <div class="fl">
        <ul class="ul-inline" style="display: none;">
          <li>
            <input class="ui-input" type="text" id="goods"/>
          </li>
          <li>
            <span id="storage"></span>
          </li>
          <li>
            <span id="sku"></span>
          </li>
          <li>
            <input type="text" id="matchCon" class="ui-input ui-input-ph" value="请输入序列号查询">
          </li>
          <li><a class="ui-btn mrb" id="search">查询</a><!-- <a class="ui-btn" id="refresh">刷新</a> --></li>
        </ul>
      </div>
    </div>
    <div style="width: 100%;display: flex;">

      <div class="grid-wrap" >
        <table id="grid" style="float: left;width: 300px;position: relative;">
          
        </table>
        <div id="page"></div>
        <a class="ui-btn mrb snforinventory" id="copyAll" onclick="copyAll();">复制全部&gt;</a>
      </div>

      <div class="text-sn">
        <div class="title">盘点库存序列号</div>
        <textarea id="snCon" class="ui-input" style="line-height: 1.7;"></textarea>
      </div>


      <textarea id="systemSnCon" class="ui-input" style="line-height: 1.7;display: none;"></textarea>

    </div>
    

</div>

<script>
  function copyAll(){
    var griddata = $('#grid').jqGrid("getRowData");
    var sns='';
    //console.log(griddata);
    griddata.forEach(function (self, index) {
      //console.log(self);
      if (self['sn'] != null) {
        sns+=self['sn'];
        sns+='\n';
      }
    });
    //alert(sns);
    $("#snCon").html(sns);
    $("#systemSnCon").html(sns);

  }
  $(document).ready(function () {
    $("#grid").jqGrid({
			url: '/store/inventorysn/sernumlist.html?ajax=100&store_id={$store_id}&good_id={$good_id}',
			datatype: "json",//数据来源，本地数据（local，json,jsonp,xml等）
			height: '323px',//高度，表格高度。可为数值、百分比或'auto'
      // width:'300px',
			colNames: ['<div style="text-align:left;font-size: 14px;">系统库存序列号</div>'],
			colModel: [
        {name: 'sn', width: 247 ,label: "系统库存序列号"}
      ],
      sortable: true,  //排序
		
			rowNum: 100,
			// rowList: [100, 200, 500],
			sortname: 'id',
			sortorder: "desc",
			pagerpos: "left",//分页位置

			pgbuttons: true,//翻页按钮
      rownumbers: true, //自增序号
			// pagination: true,
      pager: "#page",
    })
  })
</script>


{include file="admin@public/footer" /}